package com.mcgrobot.plugin.dynamicds;

public class DataSourceRouteHolder {
    /**
     * 主库标识
     */
    public final static String master = "masterDataSource";
    /**
     * 从库标识
     */
    public final static String slave = "slaveDataSource";

    private static final ThreadLocal<String> dataSources = new ThreadLocal<String>();

    public final static void setSlaveDataSource() {
        dataSources.set(slave);
    }

    public final static String getDataSourceKey() {
        return  dataSources.get();
    }
    public final static void clearDataSourceKey() {
        dataSources.remove();
    }
}
